From: "Stefan Stuntz" 
Date:   Thu, 22 Feb 1996 18:28:56 +0100
X-Mailer: IntuiNews 1.3b Beta 5 (3.1.96)
Subject: Re: re: Custom screens under MUI
Message-Id: <81319606@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"xCJb71.0.Mi4.LXABn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/383
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 485
X-Lines: 19
Status: RO

Sven Steiniger wrote

> Yep as my routines use an independent colorsystem they will run on
> every screen (I hope). The program runs fine on a CyberVision-Screen
> (CyberGfx) but doesnt use 24bit yet.
> There is an other problem. How could I check that the screen has
> 16 or 24bit ?

muiRenderInfo(obj):

/*
** If mri_Flags & MUIMRI_TRUECOLOR, display environment is a
** cybergraphics emulated hicolor or true color display.
*/
#define MUIMRI_TRUECOLOR (1<<1)

--
Greetings, Stefan


From: "Stefan Stuntz" 
Date:   Mon, 26 Feb 1996 19:20:49 +0100
X-Mailer: IntuiNews 1.3b Beta 5 (3.1.96)
Subject: Re: Object's Font ?
Message-Id: <81319682@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"rhPKw.0.9E2.MpVCn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/423
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 621
X-Lines: 23
Status: RO

Gilles Masson wrote

> I want to know which is the font of an object, so i've
> tried the MUI_Area 's attribute :
>   MUIA_Font -- (V4 ) [I.G], struct TextFont *
> but i get only a number which is one of
>         MUIV_Font_Inherit
>         MUIV_Font_Normal
>         MUIV_Font_List
>         MUIV_Font_Tiny
>         MUIV_Font_Fixed
>         MUIV_Font_Title
>         MUIV_Font_Big
>         MUIV_Font_Button
> So my question is :  how can i get TextFont infos about
> these user's prefs font ???

You can get the font of an object with the macro
_font(obj) between MUIM_Setup and MUIM_Cleanup.

--
Greetings, Stefan


From: "Stefan Stuntz" 
Date:   Tue, 05 Mar 1996 18:21:05 +0100
X-Mailer: IntuiNews 1.3b Beta 5 (3.1.96)
Subject: Re: MUI 3.3 crashes!
Message-Id: <81319789@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"juysW2.0.h86.qFCFn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/497
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 837
X-Lines: 29
Status: RO

Kai Hofmann wrote in article <60805071@informatik.uni-bremen.de>:

> I tried to open muimaster.library under OS3.1 from within
> SAS-C 6.56's __UserLibInit()
>
> snoopdos show me that
>
> muimaster.library, muigfx.library will be loaded
>
> and then by loading muilowlevel.library the whole machine will crash!
>
>
> So I can not put all my GUI stuff into  shared library to make it easy
> exchangeable with an X GUI shared library.
>
> :(((((((((((((

LibInit code is generally *not* allowed to break Forbid() and thus may
*never* open disk based libraries. Use LibOpen code for this!

> Btw. I am STILL waiting for public custom class developer material including
> infos about how to include a custom class into the pref manager!

Well, these docs are not written yet, so all you can do is wait until
they are.

--
Greetings, Stefan


From: "Stefan Stuntz" 
Date:   Wed, 06 Mar 1996 19:57:52 +0100
X-Mailer: IntuiNews 1.3b Beta 5 (3.1.96)
Subject: Custom class library init code
Message-Id: <81319816@magic.informatik.tu-muenchen.de>
Organization: Home of MUI
Resent-Message-Id: <"uz_X01.0.pR5.oFUFn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/508
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 2919
X-Lines: 67
Status: RO

Marcel Jantz wrote in article <1760.6639T722T2493@public.ndh.com>:

> >> I tried to open muimaster.library under OS3.1 from within
> >> SAS-C 6.56's __UserLibInit()
> >>
> >> snoopdos show me that
> >>
> >> muimaster.library, muigfx.library will be loaded
> >>
> >> and then by loading muilowlevel.library the whole machine will crash!
> >>
> >>
> >> So I can not put all my GUI stuff into  shared library to make it easy
> >> exchangeable with an X GUI shared library.
> >>
> >> :(((((((((((((
>
> >LibInit code is generally *not* allowed to break Forbid() and thus may
> >*never* open disk based libraries. Use LibOpen code for this!
>
> ??? Everyone does it in libinit, even the provided ExtClass example.

Indeed. This example suxx badly! :-)

If you want to know how to do it correctly, have a look at mccheader.c
from the mcc developer documentation (ask kmel for this).

> So this
> can not be the correct reason.

Maybe its not the reason for the crash. Anyway... libinit and libexpunge
code is *not* allowed to break a forbid. Opening disk-based libraries,
creating ports, etc. in lib init code is a very bad idea. Just the case
that many programmers do it doesnt make it any better.

The correct approach is to init a semaphore in libinit, obtain it in
libopen, check if the open counter is still 0 (i.e. its the first time
the lib is opened) and then initialize all your stuff. Same goes with
LibClose: obtain the semaphore, check if its the last time the lib is
closed and then exit all your stuff.

> Btw, I experienced also a strange behaviour with opening libraries.
> I've written a boopsi class, which is inherited from another boopsi class of
> mine, lets call it imagegadget and the parent areagadget.
> When using a MUI custom class (call it MArea, which is inherited from
> MUIC_Boopsi) and opening the boopsi gadget (imagegadget, which opens
> areagadget), everything works fine. After inheriting a MUI class from MArea
> class (well, sounds strange, but thats the way, OOP goes), call this class
> MClose,  loading the imagegadget from MArea works, but loading areagadget
> from imagegadget crashes the machine.
> Maybe there are some difficulties in MUI_CreateCustomClass (which is used
> to create MArea and therefore imagegadget and areagadget) ?
> Because when opening the areagadget in MArea (which should be done by
> imagegadget) everything works fine. Some ideas ?

I am not sure if I understood this but in general, you have to be *very*
careful not to MUI_DeleteCustomClass() a class which still has objects
or subclasses. This can get quite tricky, especially when dealing with
external libraries that get flushed etc. from ramlib in random order.

Be sure to check your programs with mungwall and poolwatch since they
will make your stuff crash almost certainly if you do something like the
above. Without these tools, your program will only crash very rarely.

--
Greetings, Stefan